/**
 * org.vz.product.data.collect.service.impl
 * @since : jdk 1.8
 */
package org.vz.product.collect.maintain.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.vz.product.collect.maintain.dao.KettleTransDao;
import org.vz.product.collect.maintain.domain.AcquisitionTask;
import org.vz.product.collect.maintain.domain.KettleTransformation;
import org.vz.product.collect.maintain.service.KettleTransService;

/**
 * @author      chenhuaijin
 * @CreateTime  2017年7月27日 上午11:47:47
 * @version     1.0.0
 * @description TODO
 */
@Service
public class KettleTransServiceImpl implements KettleTransService {
	@Autowired
	KettleTransDao ktrDao;
	
	public List<KettleTransformation> listAll(){		
	
		List<KettleTransformation> list = null;
		list = ktrDao.all();
		return list;
	
	}

	/* (non-Javadoc)
	 * @see org.vz.product.data.collect.service.KettleTransService#findKtrById(java.lang.String)
	 */
	@Override
	public KettleTransformation findKtrById(long id) {
		
		KettleTransformation ktr = ktrDao.unique(id);
		
		return ktr;
	}

	/* (non-Javadoc)
	 * @see org.vz.product.data.collect.service.KettleTransService#findKtrByAcTasks(java.util.List)
	 */
	@Override
	public List<KettleTransformation> findKtrByAcTasks(List<AcquisitionTask> jobs) {
		List<KettleTransformation> KettleTranses=new ArrayList<>();
		for (AcquisitionTask acquisitionTask : jobs) {
			KettleTransformation ktrTrans = ktrDao.unique(acquisitionTask.getIdktr());
			KettleTranses.add(ktrTrans);
		}
		return KettleTranses;
	}

}
